package cn.hdmis.service.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import cn.hdmis.bean.QueryResult;
import cn.hdmis.dao.TeacherDao;
import cn.hdmis.entity.Teacher;
import cn.hdmis.service.TeacherService;

public class TeacherServiceImpl implements TeacherService {
	
	private TeacherDao teacherDao;

	public void setTeacherDao(TeacherDao teacherDao) {
		this.teacherDao = teacherDao;
	}

	public TeacherDao getTeacherDao() {
		return teacherDao;
	}

	@Override
	public void addTeacher(Teacher teacher) {
		teacherDao.addTeacher(teacher);

	}

	@Override
	public Teacher getTeacher(int id) {
		return teacherDao.findByID(id);
	}
	
	@Override
	public List<Teacher> getAllTeacher() {
		return teacherDao.findAllEntity();
	}
	@Override
	public QueryResult<Teacher> getAllTeacher(int firstindex, int pageSize) {
		return  this.teacherDao.getScrollData(firstindex, pageSize);
	}
	
	@Override
	public QueryResult<Teacher> getAllTeacher(int firstindex, int pageSize,
			Map<String, Object> queryParamsMap) {
		// TODO Auto-generated method stub
		return this.teacherDao.getScrollData(firstindex, pageSize, queryParamsMap);
	}

	@Override
	public void deleteTeacher(int id) {
		this.teacherDao.removeTeacher(id);
	}

	@Override
	public void deleteTeacherList(List<Serializable> ids) {
		this.teacherDao.deleteList(ids);
	}
	
	
}
